local ServerOHOH = _G.ServerOHOH;
local M = ServerOHOH.class.new(script, ServerOHOH.files.Server_PlayerComponent(),script.Parent.Name);
local GeneralTool=_G.CommonOHOH.load.GeneralTool();
local InstanceManager = ServerOHOH.load.InstanceManager();



local SceneFolder=workspace:WaitForChild("Scene")
for _,model in pairs(SceneFolder:GetChildren()) do
    local path=string.format("PVPTouch.%s.Touch",1) --碰撞体路径

        local touch=ServerOHOH:GetPath_Loop(path,model)
        touch.Touched:Connect(function(otherPart)
             local playerInst=GeneralTool.TouchPlayerEvent(otherPart)
             if playerInst then
                local player= InstanceManager:FindObject(playerInst)
                -- player:GetComponent(_G.CommonOHOH.load.Common_PVPBattlCtrl()):EnterPvPScene()
             end
        end)
end


function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);
    self.player=self.parent
end;

function M.dtor(self)
end;


-- function M.isCanEnterLevel(self,levelId)
--     return true --临时测试
-- end


function M.EnterPvPScene(self,sid,index)
        self.player:GetComponent(_G.CommonOHOH.load.Common_PVPTrackCtrl()):CreatePVPTrack()
end


return M